<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8"/>
    <title>order</title>
    <link rel="stylesheet" type="text/css" href="css/public.css"/>
    <link rel="stylesheet" type="text/css" href="css/proList.css"/>
    <link rel="stylesheet" type="text/css" href="css/mygxin.css"/>
</head>
<body>
<!----------------------------------------order------------------>

<div class="head ding">
    <div class="wrapper clearfix">
        <div class="clearfix" id="top">
            <h1 class="fl"><a href="index.html"><img src="img/logo.png"/></a></h1>
            <div class="fr clearfix" id="top1">
                <p class="fl">
                    <a href="#" id="login">登录</a>
                    <a href="#" id="reg">注册</a>
                </p>
                <form action="#" method="get" class="fl">
                    <input type="text" placeholder="搜索"/>
                    <input type="button"/>
                </form>
                <div class="btn fl clearfix">
                    <a href="mygxin.html"><img src="img/grzx.png"/></a>
                    <a href="#" class="er1"><img src="img/ewm.png"/></a>
                    <a href="cart.html"><img src="img/gwc.png"/></a>
                    <p><a href="#"><img src="img/smewm.png"/></a></p>
                </div>
            </div>
        </div>
        <ul class="clearfix" id="bott">
            <li><a href="index.html">首页</a></li>
            <li>
                <a href="#">所有商品</a>
                <div class="sList">
                    <div class="wrapper  clearfix">
                        <a href="paint.html">
                            <dl>
                                <dt><img src="img/nav1.jpg"/></dt>
                                <dd>浓情欧式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="img/nav2.jpg"/></dt>
                                <dd>浪漫美式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="img/nav3.jpg"/></dt>
                                <dd>雅致中式</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="img/nav6.jpg"/></dt>
                                <dd>简约现代</dd>
                            </dl>
                        </a>
                        <a href="paint.html">
                            <dl>
                                <dt><img src="img/nav7.jpg"/></dt>
                                <dd>创意装饰</dd>
                            </dl>
                        </a>
                    </div>
                </div>
            </li>
            <li>
                <a href="flowerDer.html">装饰摆件</a>
                <div class="sList2">
                    <div class="clearfix">
                        <a href="proList.html">干花花艺</a>
                        <a href="vase_proList.html">花瓶花器</a>
                    </div>
                </div>
            </li>
            <li>
                <a href="decoration.html">布艺软饰</a>
                <div class="sList2">
                    <div class="clearfix">
                        <a href="zbproList.html">桌布罩件</a>
                        <a href="bzproList.html">抱枕靠垫</a>
                    </div>
                </div>
            </li>
            <li><a href="paint.html">墙式壁挂</a></li>
            <li><a href="perfume.html">蜡艺香薰</a></li>
            <li><a href="idea.html">创意家居</a></li>
        </ul>
    </div>
</div>

<div th:replace="headbing.html"></div>


<div class="order cart mt">
    <!-----------------site------------------->
    <div class="site">
        <p class="wrapper clearfix">
            <span class="fl">订单确认</span>
            <img class="top" src="img/temp/cartTop02.png">
        </p>
    </div>
    <!-----------------orderCon------------------->
    <div class="orderCon wrapper clearfix">
        <div class="orderL fl">
            <!--------h3---------------->
            <h3>收件信息<a href="address.html" class="fr" style="color: red">"亲" 没有地址的话 点我去新增地址哦</a></h3>
            <!--------addres---------------->
            <div class="addres clearfix">
                <div th:each="c:${furnAddresstables}" class="addre fl on">
                    <div class="tit clearfix">
                        <p class="fl">
                            <a th:id="'s'+${c.id}"><th:block th:text="${c.consignee}"></th:block></a>
                            <span class="default">[默认地址]</span>
                        </p>
                        <p class="fr">
                            <span>|</span>
                            <a th:onclick="'update2('+${c.id}+')'" class="edit">编辑</a>
                        </p>
                    </div>
                    <div class="addCon">
                        <p th:id="'bacc'+${c.id}" th:text="${c.province +'|'+ c.city +'|'+ c.area +'|'+c.detailed+'|'}">河北省&nbsp;唐山市&nbsp;路北区&nbsp;大学生公寓村</p>
                        <p th:id="'b'+${c.id}" th:text="${c.address}"></p>
                        <p th:id="'a'+${c.id}" th:text="${c.phone}"></p>
                    </div>
                </div>
            </div>
            <h3>支付方式</h3>
            <!--------way---------------->
            <div class="way clearfix">
                <img class="on" src="img/temp/way01.jpg">
                <img src="img/temp/way02.jpg">
                <img src="img/temp/way03.jpg">
                <img src="img/temp/way04.jpg">
            </div>
            <h3>选择快递</h3>
            <!--------dis---------------->
            <div class="dis clearfix">
                <span class="on">顺风快递</span>
                <span>百世汇通</span>
                <span>圆通快递</span>
                <span>中通快递</span>
            </div>
        </div>
        <div class="orderR fr">
            <div class="msg">
                <h3>订单内容<a href="selcart.html" class="fr">返回购物车</a></h3>
                <!--------ul---------------->
                <ul class="clearfix" >
                    <li class="fl">
                        <img th:height="120" th:width="120" th:src="${furnCommodity.imagestheme}"/>
                    </li>
                    <li class="fl">
                        <p style="width: 200px;height: 50px; line-height: 14px" th:text="${furnCommodity.productname}">创意现代简约干花花瓶摆件</p>
                        <p >颜色分类: <span th:text="${furnCommodity.classificationtypeId}"></span></p>
                        <p>数量：<span th:text="${furnCommodity.quantity}"></span></p>
                    </li>
                    <li class="fr" th:text="${furnCommodity.commodityprices}">￥69.90</li>
                </ul>

            </div>
            <!--------tips---------------->
            <div class="tips">
                <p><span class="fl">商品金额：</span><span class="fr" th:text="${sum}">￥139.80</span></p>
                <p><span class="fl">优惠金额：</span><span class="fr">￥0.00</span></p>
                <p><span class="fl">运费：</span><span class="fr">免运费</span></p>
            </div>
            <!--------tips count---------------->
            <div class="count tips">
                <div class="count tips">
                    <p><span class="fl">合计：</span><span class="fr" th:text="${sum}">￥139.80</span></p>
                </div>
                <!--<input type="button" name="" value="去支付"> -->
                <a th:href="'/FurnOrdersadd2?sum='+${sum}+'&name='+${name}+'&ColourId='+${ColourId}+'&CommodityId='+${CommodityId}" class="pay">去支付</a>
            </div>
        </div>
    </div>
    <!--编辑弹框-->
    <!--遮罩-->
    <div class="mask"></div>
    <div class="adddz editAddre">
        <form action="#" method="get">
            <input type="text" id="name2" placeholder="姓名" class="on" />
            <input type="text" id="dada" placeholder="手机号" />
            <div class="city" id="demo3">
                <select id="province2" name="province">
                    <option  value="省份/自治区">省份/自治区</option>
                </select>
                <select id="city2" name="city">
                    <option value="城市/地区">城市/地区</option>
                </select>
                <select id="area2" name="area">
                    <option value="区/县">区/县</option>
                </select>
                <select id="town2" name="town">
                    <option value="街道">配送区域</option>
                </select>
            </div>
            <textarea name="" rows="" id="baaa" cols="" placeholder="详细地址"></textarea>
            <div class="bc">
                <input type="button" onclick="save2()" value="保存" />
                <input type="button" value="取消" />
            </div>
        </form>
    </div>
    <!--返回顶部-->
    <div th:replace="gotop.html"></div>
    <!--footer-->
    <div class="footer">
        <div class="top">
            <div class="wrapper">
                <div class="clearfix">
                    <a href="#2" class="fl"><img src="img/foot1.png"/></a>
                    <span class="fl">7天无理由退货</span>
                </div>
                <div class="clearfix">
                    <a href="#2" class="fl"><img src="img/foot2.png"/></a>
                    <span class="fl">15天免费换货</span>
                </div>
                <div class="clearfix">
                    <a href="#2" class="fl"><img src="img/foot3.png"/></a>
                    <span class="fl">满599包邮</span>
                </div>
                <div class="clearfix">
                    <a href="#2" class="fl"><img src="img/foot4.png"/></a>
                    <span class="fl">手机特色服务</span>
                </div>
            </div>
        </div>
        <p class="dibu">最家家居&copy;2013-2017公司版权所有 京ICP备080100-44备0000111000号<br />
            违法和不良信息举报电话：188-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</p>
    </div>
    <script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/pro.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/user.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="js/jquery.min.js" ></script>
    <script type="text/javascript" src="js/jquery.citys.js"></script>
    <script type="text/javascript">
        var $town = $('#demo3 select[name="town"]');
        var townFormat = function(info){
            $town.hide().empty();
            if(info['code']%1e4&&info['code']<7e5){	//是否为“区”且不是港澳台地区
                $.ajax({
                    url:'http://passer-by.com/data_location/town/'+info['code']+'.json',
                    dataType:'json',
                    success:function(town){
                        $town.show();
                        for(i in town){
                            $town.append('<option value="'+i+'">'+town[i]+'</option>');
                        }
                    }
                });
            }
        };
        $('#demo3').citys({
            province:'福建',
            city:'厦门',
            area:'思明',
            onChange:function(info){
                townFormat(info);
            }
        },function(api){
            var info = api.getInfo();
            townFormat(info);
        });
    </script>
    <script>
        var pid;
        function update2(id) {
            pid = id;
            //姓名
            var a=$("#s"+pid).text();
            //配送地址
            var b=$("#b"+pid).text();
            //电话
            var c=$("#a"+pid).text();
            $("#name2").val(a);
            $("#dada").val(c);
            $("#baaa").val(b);

        }
        function save2() {
            //姓名
            var a1=$("#name2").val();
            //电话
            var a2=$("#dada").val();
            //省市区街道
            var a3=$("#province2 option:selected").text();
            var a4=$("#city2 option:selected").text();
            var a5=$("#area2 option:selected").text();
            var a6=$("#town2 option:selected").text();
            //详细地址
            var a7=$("#baaa").val();
            $.ajax({
                url:"http://localhost:8080/update",
                data:{
                    "a1":a1,
                    "a2":a2,
                    "a3":a3,
                    "a4":a4,
                    "a5":a5,
                    "a6":a6,
                    "a7":a7,
                    "pid":pid
                },
                success:function (resp) {
                    if (resp.success){
                        var count=resp.data;
                        if (count>0){
                            //姓名
                            $("#s"+pid).text(a1);
                            //电话
                            $("#a"+pid).text(a2);
                            //详细地址
                            $("#b"+pid).text(a7);
                            $("#bacc"+pid).text(a3+"|"+a4+"|"+a5+"|"+a6);
                        }
                    }else {

                    }

                },
            })

        }
    </script>
</body>
</html>
